<style>
    body{
        background:#f2f2f2!important;
    }
    .zhanshi button{
        background: #1b4fe7;
        border-radius: 5px;
        padding: 5px 10px;
    }
    input[type="button"] {
        border-radius: 5px!important;
    }
    input[type="button"]:hover{
        opacity: 0.8;
    }
    .xian {
        width: 8px;
        height: 20px;
        background: #486bd3;
        margin-right: 10px;
        margin-left: 10px;
    }
    .tab-labels{
        box-sizing: border-box;
        background: #edf0f9;
        display: flex;
        align-items: center;
        font-size: 16px;
        color: #333;
        line-height: 30px;
        margin-bottom: 10px;
        /*margin-top: 10px;*/
        /*margin-top: 10px;*/
    }
    input{
        background-color: #fff!important;
    }
    input{
        background-color: #fff!important;
    }
    select{
        background-color: #fff!important;
    }
    textarea{
        background-color: #fff!important;
    }
    .tcxm-td td{
        background: #4e73df;
        color: #fff;
        text-align: center;
        border-right: 1px solid;
    }
    .form-inline input{
        width: 100%!important;
    }
    #tab4 .form-inline td:nth-child(1) input{
        width: 12%!important;
    }
    .form-inline td{
        border-right: 1px solid #e6e6e6;
        border-bottom: 1px solid #e6e6e6;
    }
    .form-inline td:nth-child(1){
        border-left: 1px solid #e6e6e6;
    }
    .form-inline td:nth-child(1){
        text-align: center;
    }
    .form-inline1 td{
        border-top: 1px solid #e6e6e6!important;
    }
    .hang .col-sm-2 {
        width: 100%;
        text-align: left;
    }
    .hang{
        width: 100%;
        display: flex;
        margin-left: 20px;
    }
    .hang .form-group{
        width: 25%;
        float: left;
    }
    form{
        background-color: #fff;
    }
    .lisuan{
        background-color: #fff;
    }
    .tab11{
        display: none;
    }
    .tabs-content > .tab1 {
        display: none;
    }
    .tabs-content > div.active {
        display: block;
    }
    .tab-label1.active{
        background: #4e73df;
        color: #fff;
    }
    .tab-label1{
        width: 100px;
        text-align: center;
        cursor: pointer;
        height: 30px;
        line-height: 30px;
        border-radius: 4px;
        margin-left: 40px;
        margin-bottom: 0;
    }
    .tab-label1:nth-child(1){
        margin-left: 0;
    }
    .tab-top-label{
        box-sizing: border-box;
        /*background: #e3eced;*/
        display: flex;
        align-items: center;
        font-size: 14px;
        color: #666;
        line-height: 30px;
        margin-bottom: 10px;
    }
    .style1{
        line-height: 0;
        margin-left: 0;
        width: auto;
    }

    .tab-label2{
        width: auto;
        text-align: center;
        cursor: pointer;
        height: 30px;
        /*line-height: 30px;*/
        border-radius: 4px;
        /*margin-left: 40px;*/
        margin-bottom: 0;
    }

    .zhanshi{
        display: none;
    }
</style>
<!--理算-->
<div class="lisuan">
    <div class="form-group" style="height: 30px;">
        <label class="control-label col-xs-12 col-sm-2" style="width: 130px">{:__('是否快速审核')}:</label>
        <div class="col-xs-12 col-sm-10">
            <input type="radio" name="kuai_shen" id="kuai_shen" value="2" <?= isset($lisuan['kuai']) && $lisuan['kuai'] == 2 ? ' checked="checked"' : '';?> /> 否
            <input type="radio" name="kuai_shen" id="kuai_shen" value="1" <?= isset($lisuan['kuai']) && $lisuan['kuai'] == 1 ? ' checked="checked" ' : '';?> /> 是
        </div>
    </div>
    <div class="tabs tab11">
        <div class="tab-top-label ">
            <label class="tab-label1 active" for="tab11">理算</label>
            <label class="tab-label1" for="tab22">补偿款信息</label>
        </div>
        <div class="tabs-content">
            <!--            理算-->
            <div id="tab11" class="tab1 active">
                <form  id="benche-lisuan-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
                    <input type="hidden" name="row[sid]" value="{$sid}">
                    <input type="hidden" name="row[bid]" value="{$bid}">
                    <div class="tab active">
                        <div class="tab-labels">
                            <div class="xian"></div>
                            理算
                        </div>
                        <div class="form-group" style="margin-bottom: 0">
                            <div class="col-xs-12">
                                <table class="table fieldlist" data-template="basictpl" data-name="res[basic]" id="first-table3">
                                    <tr class="tcxm-td">
                                        <td></td>
                                        <td>{:__('本车损失')}</td>
                                        <td>{:__('本车人伤')}</td>
                                        <td>{:__('三者车损失')}</td>
                                        <td>{:__('三者物损')}</td>
                                        <td>{:__('三者车人伤')}</td>
                                    </tr>
                                    <tr class="form-inline">
                                        <td>金额</td>
                                        <td><input type="text" id="benche_money" class="form-control" value="{$lisuan.benche_money|htmlentities}" name="row[benche_money]" oninput="v2()"/></td>
                                        <td><input type="text" id="benshang_money" class="form-control" value="{$lisuan.benshang_money|htmlentities}" name="row[benshang_money]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanche_money" class="form-control" value="{$lisuan.sanche_money|htmlentities}" name="row[sanche_money]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanwu_money" class="form-control" value="{$lisuan.sanwu_money|htmlentities}" name="row[sanwu_money]" oninput="v2()" /></td>
                                        <td><input type="text" id="sanshang_money" class="form-control" value="{$lisuan.sanshang_money|htmlentities}"  name="row[sanshang_money]" oninput="v2()"/></td>
                                    </tr>
                                    <tr class="form-inline">
                                        <td>免赔额</td>
                                        <td><input type="text" id="benche_miane" class="form-control" value="{$lisuan.benche_miane|htmlentities}" name="row[benche_miane]" oninput="v2()"/></td>
                                        <td><input type="text" id="benshang_miane" class="form-control" value="{$lisuan.benshang_miane|htmlentities}" name="row[benshang_miane]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanche_miane" class="form-control" value="{$lisuan.sanche_miane|htmlentities}" name="row[sanche_miane]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanwu_miane" class="form-control" value="{$lisuan.sanwu_miane|htmlentities}" name="row[sanwu_miane]" oninput="v2()" /></td>
                                        <td><input type="text" id="sanshang_miane" class="form-control" value="{$lisuan.sanshang_miane|htmlentities}"  name="row[sanshang_miane]" oninput="v2()"/></td>
                                    </tr>
                                    <tr class="form-inline">
                                        <td>免赔率(%)</td>
                                        <td><input type="text" id="benche_mianlv" class="form-control" value="{$lisuan.benche_mianlv|htmlentities}" name="row[benche_mianlv]" oninput="v2()"/></td>
                                        <td><input type="text" id="benshang_mianlv" class="form-control" value="{$lisuan.benshang_mianlv|htmlentities}" name="row[benshang_mianlv]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanche_mianlv" class="form-control" value="{$lisuan.sanche_mianlv|htmlentities}" name="row[sanche_mianlv]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanwu_mianlv" class="form-control" value="{$lisuan.sanwu_mianlv|htmlentities}" name="row[sanwu_mianlv]" oninput="v2()" /></td>
                                        <td><input type="text" id="sanshang_mianlv" class="form-control" value="{$lisuan.sanshang_mianlv|htmlentities}"  name="row[sanshang_mianlv]" oninput="v2()"/></td>
                                    </tr>
                                    <tr class="form-inline">
                                        <td>事故责任(%)</td>
                                        <td><input type="text" id="benche_zeren" class="form-control" value="{$lisuan.benche_zeren|htmlentities}" name="row[benche_zeren]" oninput="v2()"/></td>
                                        <td><input type="text" id="benshang_zeren" class="form-control" value="{$lisuan.benshang_zeren|htmlentities}" name="row[benshang_zeren]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanche_zeren" class="form-control" value="{$lisuan.sanche_zeren|htmlentities}" name="row[sanche_zeren]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanwu_zeren" class="form-control" value="{$lisuan.sanwu_zeren|htmlentities}" name="row[sanwu_zeren]" oninput="v2()" /></td>
                                        <td><input type="text" id="sanshang_zeren" class="form-control" value="{$lisuan.sanshang_zeren|htmlentities}"  name="row[sanshang_zeren]" oninput="v2()"/></td>
                                    </tr>
                                    <tr class="form-inline">
                                        <td>交强险</td>
                                        <td><input type="text" id="benche_qiangxian" class="form-control" value="{$lisuan.benche_qiangxian|htmlentities}" name="row[benche_qiangxian]" oninput="v2()"/></td>
                                        <td><input type="text" id="benshang_qiangxian" class="form-control" value="{$lisuan.benshang_qiangxian|htmlentities}" name="row[benshang_qiangxian]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanche_qiangxian" class="form-control" value="{$lisuan.sanche_qiangxian|htmlentities}" name="row[sanche_qiangxian]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanwu_qiangxian" class="form-control" value="{$lisuan.sanwu_qiangxian|htmlentities}" name="row[sanwu_qiangxian]" oninput="v2()" /></td>
                                        <td><input type="text" id="sanshang_qiangxian" class="form-control" value="{$lisuan.sanshang_qiangxian|htmlentities}"  name="row[sanshang_qiangxian]" oninput="v2()"/></td>
                                    </tr>
                                    <tr class="form-inline">
                                        <td>其他</td>
                                        <td><input type="text" id="benche_qita" class="form-control" value="{$lisuan.benche_qita|htmlentities}" name="row[benche_qita]" oninput="v2()"/></td>
                                        <td><input type="text" id="benshang_qita" class="form-control" value="{$lisuan.benshang_qita|htmlentities}" name="row[benshang_qita]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanche_qita" class="form-control" value="{$lisuan.sanche_qita|htmlentities}" name="row[sanche_qita]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanwu_qita" class="form-control" value="{$lisuan.sanwu_qita|htmlentities}" name="row[sanwu_qita]" oninput="v2()" /></td>
                                        <td><input type="text" id="sanshang_qita" class="form-control" value="{$lisuan.sanshang_qita|htmlentities}"  name="row[sanshang_qita]" oninput="v2()"/></td>
                                    </tr>
                                    <tr class="form-inline">
                                        <td>合计</td>
                                        <td><input type="text" id="benche_heji" class="form-control" value="{$lisuan.benche_heji|htmlentities}" name="row[benche_heji]" oninput="v2()"/></td>
                                        <td><input type="text" id="benshang_heji" class="form-control" value="{$lisuan.benshang_heji|htmlentities}" name="row[benshang_heji]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanche_heji" class="form-control" value="{$lisuan.sanche_heji|htmlentities}" name="row[sanche_heji]"  oninput="v2()"/></td>
                                        <td><input type="text" id="sanwu_heji" class="form-control" value="{$lisuan.sanwu_heji|htmlentities}" name="row[sanwu_heji]" oninput="v2()" /></td>
                                        <td><input type="text" id="sanshang_heji" class="form-control" value="{$lisuan.sanshang_heji|htmlentities}"  name="row[sanshang_heji]" oninput="v2()"/></td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                        <div class="hang">
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('其他费用')}:</label>
                                <div class="col-xs-12 col-sm-10">
                                    <input id="qita" class="form-control" name="row[qita]" type="text" value="{$lisuan.qita|htmlentities}" >
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('本车合计')}:</label>
                                <div class="col-xs-12 col-sm-10">
                                    <input id="b_heji" class="form-control" type="text" name="row[b_heji]" value="{$lisuan.b_heji|htmlentities}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('三者车合计')}:</label>
                                <div class="col-xs-12 col-sm-10">
                                    <input id="s_heji" class="form-control" type="text" name="row[s_heji]" value="{$lisuan.s_heji|htmlentities}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('总计')}:</label>
                                <div class="col-xs-12 col-sm-10">
                                    <input id="zongji" class="form-control" type="text" name="row[zongji]" value="{$lisuan.zongji|htmlentities}">
                                </div>
                            </div>
                        </div>
                        <div class="hang">
                            <div class="form-group" style="width: 100%;">
                                <label class="control-label col-xs-12 col-sm-2">{:__('备注意见')}:</label>
                                <div class="col-xs-12 col-sm-10">
                                    <textarea id="beizhu" class="form-control" name="row[beizhu]" type="text" cols="10" rows="5" >{$lisuan.beizhu|htmlentities}</textarea>
                                </div>
                            </div>
                        </div>
<!--                        <div class="form-group zhanshi" style="margin-top: 50px;padding-bottom: 50px;">-->
<!--                            <label class="control-label col-xs-12 col-sm-2"></label>-->
<!--                            <div class="col-xs-12 " style="text-align:center;margin: auto;">-->
<!--                                <button type="button" class="btn btn-primary btn-embossed " style="margin-left: 10px;" onclick="lisuan_save()">{:__('保存')}</button>-->
<!--                            </div>-->
<!--                        </div>-->
                    </div>
                </form>

            </div>
            <!--            理算结束-->
            <!--            补偿款信息-->
            <div id="tab22" class="tab1">
                <div class="hang">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('被服务人')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input class="form-control" type="text" value="{$row.learned_name}"  readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('证件类型')}:</label>
                        <select class="form-control" disabled>
                            <option value="0" {if condition="$row['learned_kind'] eq 0"}selected{else/}''{/if}>身份证</option>
                            <option value="1" {if condition="$row['learned_kind'] eq 1"}selected{else/}''{/if}>统一社会信用代码</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('证件号')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input class="form-control" type="text" value="{$row.learned_name}"  readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('电话')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input class="form-control" type="text" value="{$row.learned_phone}"  readonly>
                        </div>
                    </div>
                </div>
                <form  id="benche-buchangkuan-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
                    <input type="hidden" name="row[sid]" value="{$sid}">
                    <input type="hidden" name="row[bid]" value="{$bid}">
                    <div class="tab-labels">
                        <div class="xian"></div>
                        补偿款信息
                    </div>
                    <div class="form-group zhanshi">
                        <label class="control-label col-xs-12 col-sm-2"></label>
                        <div class="col-xs-12 ">
                            <button  class="tab-label2 btn btn-primary btn-embossed style1" type="button" onclick="AddRowshoukuan(document.getElementById('first-table4'),1)">增加</button>
                            <button  class="tab-label2 btn btn-primary btn-embossed style1" type="button" style="background:#f75444" onclick="benche_shoukuan_del(document.getElementById('first-table4'));">删除</button>
<!--                            <button  class="tab-label2 btn btn-primary btn-embossed style1" type="button" onclick="buchangkuan()">保存数据</button>-->
                        </div>
                    </div>
                    <div class="form-group" style="margin-bottom: 0">
                        <div class="col-xs-12">
                            <table class="table fieldlist" data-template="basictpl" data-name="res[basic]" id="first-table4">
                                <tr class="tcxm-td">
                                    <td style="width: 50px;">{:__('选择')}</td>
                                    <td>{:__('收款人')}</td>
                                    <td>{:__('证件类型')}</td>
                                    <td>{:__('证件号')}</td>
                                    <td>{:__('电话')}</td>
                                    <td>{:__('与被服务人关系')}</td>
                                    <td>{:__('开户行')}</td>
                                    <td>{:__('账号')}</td>
                                    <td>{:__('金额')}</td>
                                </tr>

                                {empty name="shoukuan"}
                                <tr class="form-inline">
                                    <td><input type="checkbox" style='width: 20px!important;height: 20px;display: block;margin:0 auto;margin-top: 6px;' name="row[id][]" value="" class="bc_id"></td>
                                    <td><input type="text"  class="form-control " value="" name="row[shoukuan_ren][]" /></td>
                                    <td><input type="text"  class="form-control " value="" name="row[shoukuan_kind][]" list="buchang_shoukuan_type"/>
                                        <datalist id='buchang_shoukuan_type'>
                                            <option value="身份证">身份证</option>
                                            <option value="统一社会信用代码">统一社会信用代码</option>
                                        </datalist>
                                    </td>
                                    <td><input type="text"  class="form-control " value="" name="row[shoukuan_card][]"/></td>
                                    <td><input type="text"  class="form-control " value="" name="row[shoukuan_phone][]"/></td>
                                    <td><input type="text"  class="form-control " value="" name="row[shoukuan_relation][]" /></td>
                                    <td><input type="text"  class="form-control " value="" name="row[shoukuan_bank][]" /></td>
                                    <td><input type="text"  class="form-control " value="" name="row[shoukuan_account][]"/></td>
                                    <td><input type="text"  class="form-control " value="" name="row[shoukuan_money][]"/></td>
                                </tr>
                                {/empty}
                                {volist name="shoukuan" id="vo"}
                                <tr class="form-inline">
                                    <td><input type="checkbox" name="row[id][]"  style='width: 20px!important;height: 20px;display: block;margin:0 auto;margin-top: 6px;' value="{$vo.id}" class="bc_id">
                                        <input class="iid" type="hidden" name="row[id][]" value="{$vo.id}">
                                    </td>
                                    <td><input type="text"  class="form-control " value="{$vo.ren}" name="row[shoukuan_ren][]" /></td>
                                    <td><input type="text"  class="form-control " value="{$vo.kind}" name="row[shoukuan_kind][]" list="buchang_shoukuan_type"/>
                                        <datalist id='buchang_shoukuan_type'>
                                            <option value="身份证">身份证</option>
                                            <option value="统一社会信用代码">统一社会信用代码</option>
                                        </datalist>
                                    </td>
                                    <td><input type="text"  class="form-control " value="{$vo.card}" name="row[shoukuan_card][]"/></td>
                                    <td><input type="text"  class="form-control " value="{$vo.phone}" name="row[shoukuan_phone][]"/></td>
                                    <td><input type="text"  class="form-control " value="{$vo.relation}" name="row[shoukuan_relation][]"/></td>
                                    <td><input type="text"  class="form-control " value="{$vo.bank}" name="row[shoukuan_bank][]" /></td>
                                    <td><input type="text"  class="form-control " value="{$vo.account}" name="row[shoukuan_account][]"/></td>
                                    <td><input type="text"  class="form-control " value="{$vo.money}" name="row[shoukuan_money][]" /></td>
                                </tr>
                                {/volist}
                            </table>
                        </div>
                    </div>
                </form>
                <form  id="benche-qita-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
                    <input type="hidden" name="row[sid]" value="{$sid}">
                    <input type="hidden" name="row[bid]" value="{$bid}">
                    <div class="tab-labels">
                        <div class="xian"></div>
                        其他费用信息
                    </div>
                    <div class="form-group zhanshi">
                        <label class="control-label col-xs-12 col-sm-2"></label>
                        <div class="col-xs-12 ">
                            <button  class="tab-label2 btn btn-primary btn-embossed style1" type="button" onclick="AddRowshoukuan(document.getElementById('first-table5'),1)">增加</button>
                            <button  class="tab-label2 btn btn-primary btn-embossed style1" type="button" style="background:#f75444" onclick="benche_qita_del(document.getElementById('first-table5'));">删除</button>
<!--                            <button  class="tab-label2 btn btn-primary btn-embossed style1" type="button" onclick="qita_save()">保存数据</button>-->
                        </div>
                    </div>
                    <div class="form-group" style="margin-bottom: 0">
                        <div class="col-xs-12">
                            <table class="table fieldlist" data-template="basictpl" data-name="res[basic]" id="first-table5">
                                <tr class="tcxm-td">
                                    <td style="width: 50px;">{:__('选择')}</td>
                                    <td>{:__('收款人')}</td>
                                    <td>{:__('证件类型')}</td>
                                    <td>{:__('证件号')}</td>
                                    <td>{:__('电话')}</td>
                                    <td>{:__('与被服务人关系')}</td>
                                    <td>{:__('开户行')}</td>
                                    <td>{:__('开户行')}</td>
                                    <td>{:__('金额')}</td>
                                </tr>

                                {empty name="qita"}
                                <tr class="form-inline">
                                    <td><input type="checkbox" style='width: 20px!important;height: 20px;display: block;margin:0 auto;margin-top: 6px;' name="row[id][]" value="" class="qita_id"></td>
                                    <td><input type="text"  class="form-control " value="" name="row[qita_ren][]" /></td>
                                    <td><input type="text"  class="form-control " value="" name="row[qita_kind][]" list="buchang_qita_type"/>
                                        <datalist id='buchang_qita_type'>
                                            <option value="身份证">身份证</option>
                                            <option value="统一社会信用代码">统一社会信用代码</option>
                                        </datalist>
                                    </td>
                                    <td><input type="text" class="form-control " value="" name="row[qita_card][]"/></td>
                                    <td><input type="text" class="form-control " value="" name="row[qita_phone][]"/></td>
                                    <td><input type="text"  class="form-control " value="" name="row[qita_relation][]" /></td>
                                    <td><input type="text"  class="form-control " value="" name="row[qita_bank][]" /></td>
                                    <td><input type="text"  class="form-control " value="" name="row[qita_account][]"/></td>
                                    <td><input type="text"  class="form-control " value="" name="row[qita_money][]"/></td>
                                </tr>
                                {/empty}
                                {volist name="qita" id="vo"}
                                <tr class="form-inline">
                                    <td><input type="checkbox" name="row[id][]"  style='width: 20px!important;height: 20px;display: block;margin:0 auto;margin-top: 6px;'  value="{$vo.id}" class="qita_id">
                                        <input class="iid" type="hidden" name="row[id][]" value="{$vo.id}">
                                    </td>
                                    <td><input type="text"  class="form-control " value="{$vo.ren}" name="row[qita_ren][]" /></td>
                                    <td><input type="text"  class="form-control " value="{$vo.kind}" name="row[qita_kind][]" list="buchang_qita_type"/>
                                        <datalist id='buchang_qita_type'>
                                            <option value="身份证">身份证</option>
                                            <option value="统一社会信用代码">统一社会信用代码</option>
                                        </datalist>
                                    </td>
                                    <td><input type="text"  class="form-control " value="{$vo.card}" name="row[qita_card][]"/></td>
                                    <td><input type="text"  class="form-control " value="{$vo.phone}" name="row[qita_phone][]"/></td>
                                    <td><input type="text"  class="form-control " value="{$vo.relation}" name="row[qita_relation][]"/></td>
                                    <td><input type="text"  class="form-control " value="{$vo.bank}" name="row[qita_bank][]" /></td>
                                    <td><input type="text"  class="form-control " value="{$vo.account}" name="row[qita_account][]"/></td>
                                    <td><input type="text"  class="form-control " value="{$vo.money}" name="row[qita_money][]" /></td>
                                </tr>
                                {/volist}
                            </table>
                        </div>
                    </div>
                </form>
            </div>
            <!--            补偿款信息结束-->
        </div>
    </div>

</div>
<!--理算结束-->
<script src="/assets/js/ace1.4/assets/js/jquery.min.js" type="text/javascript"></script>
<script src="/assets/js/ace1.4/assets/js/add.js" type="text/javascript"></script>
<!--理算-->
<script>
    function msg(res){
        if(res.code == 1){
            layer.msg(res.msg, {
                time: 1000,
                icon: 1
            })
        }else{
            layer.msg(res.msg, {
                time: 1000,
                icon: 2
            })
        }
    }
    //标签
    $(document).ready(function() {
        $('.tab-label1').click(function() {
            // 移除所有标签的激活状态和内容的显示状态
            $('.tab-label1, .tab1').removeClass('active');
            // 添加激活状态到点击的标签和对应的内容
            $(this).addClass('active');
            $('#' + $(this).attr('for')).addClass('active');
        });
    });
    //是否显示理算
    $('input[type=radio][name=kuai_shen]').change(function() {
        if(this.value==1){
            $(".tab11").show()
        }else{
            $(".tab11").hide()
        }
    })
    $(document).ready(function() {
        if({$lisuan.kuai} == 1 || {$lisuan_status} == 1){
            $(".tab11").show()
        }
    })

    //理算
    function v2(){
        //（金额-交强险）×（1-免赔率%）×事故责任%-免赔额+其他=合计
        let sum = 0;
        // 本车损失
        let benche_money = $("#benche_money").val();
        let benche_miane = $("#benche_miane").val();
        let benche_mianlv = $("#benche_mianlv").val();
        let benche_zeren = $("#benche_zeren").val();
        let benche_qiangxian = $("#benche_qiangxian").val();
        let benche_qita = $("#benche_qita").val();
        sum = (Number(benche_money) - Number(benche_qiangxian)) * (1 - (Number(benche_mianlv) / 100)) * (Number(benche_zeren) / 100) - Number(benche_miane) + Number(benche_qita);
        $("#benche_heji").val(sum.toFixed(2));
        // 本车人伤
        sum = 0;
        let benshang_money = $("#benshang_money").val();
        let benshang_miane = $("#benshang_miane").val();
        let benshang_mianlv = $("#benshang_mianlv").val();
        let benshang_zeren = $("#benshang_zeren").val();
        let benshang_qiangxian = $("#benshang_qiangxian").val();
        let benshang_qita = $("#benshang_qita").val();
        sum = (Number(benshang_money) - Number(benshang_qiangxian)) * (1 - (Number(benshang_mianlv) / 100)) * (Number(benshang_zeren) / 100) - Number(benshang_miane) + Number(benshang_qita);
        $("#benshang_heji").val(sum.toFixed(2));
        // 三者车损失
        sum = 0;
        let sanche_money = $("#sanche_money").val();
        let sanche_miane = $("#sanche_miane").val();
        let sanche_mianlv = $("#sanche_mianlv").val();
        let sanche_zeren = $("#sanche_zeren").val();
        let sanche_qiangxian = $("#sanche_qiangxian").val();
        let sanche_qita = $("#sanche_qita").val();
        sum = (Number(sanche_money) - Number(sanche_qiangxian)) * (1 - (Number(sanche_mianlv) / 100)) * (Number(sanche_zeren) / 100) - Number(sanche_miane) + Number(sanche_qita);
        $("#sanche_heji").val(sum.toFixed(2));
        // 三者物损
        sum = 0;
        let sanwu_money = $("#sanwu_money").val();
        let sanwu_miane = $("#sanwu_miane").val();
        let sanwu_mianlv = $("#sanwu_mianlv").val();
        let sanwu_zeren = $("#sanwu_zeren").val();
        let sanwu_qiangxian = $("#sanwu_qiangxian").val();
        let sanwu_qita = $("#sanwu_qita").val();
        sum = (Number(sanwu_money) - Number(sanwu_qiangxian)) * (1 - (Number(sanwu_mianlv) / 100)) * (Number(sanwu_zeren) / 100) - Number(sanwu_miane) + Number(sanwu_qita);
        $("#sanwu_heji").val(sum.toFixed(2));
        // 三者车人伤
        sum = 0;
        let sanshang_money = $("#sanshang_money").val();
        let sanshang_miane = $("#sanshang_miane").val();
        let sanshang_mianlv = $("#sanshang_mianlv").val();
        let sanshang_zeren = $("#sanshang_zeren").val();
        let sanshang_qiangxian = $("#sanshang_qiangxian").val();
        let sanshang_qita = $("#sanshang_qita").val();
        sum = (Number(sanshang_money) - Number(sanshang_qiangxian)) * (1 - (Number(sanshang_mianlv) / 100)) * (Number(sanshang_zeren) / 100) - Number(sanshang_miane) + Number(sanshang_qita);
        $("#sanshang_heji").val(sum.toFixed(2));
        //
        $("#qita").val(Number(benche_qita) + Number(benshang_qita) + Number(sanche_qita) + Number(sanwu_qita) + Number(sanshang_qita));
        $("#b_heji").val(Number($("#benche_heji").val()) + Number($("#benshang_heji").val()));
        $("#s_heji").val(Number($("#sanche_heji").val()) + Number($("#sanwu_heji").val()) + Number($("#sanshang_heji").val()));
        $("#zongji").val(Number($("#b_heji").val()) + Number($("#s_heji").val()));
    }
    function lisuan_save(){
        // layer.confirm('确认保存吗？', {
        //     btn: ['确定', '取消'], //按钮
        //     shade: false //不显示遮罩
        // }, function(index,layero) {
        //     $(layero).find('.layui-layer-btn0').css('pointer-events','none');// 将确认按钮鼠标事件设置为无效
        //     $(layero).find('.layui-layer-btn0').html('保存中...');// 将确认按钮鼠标事件设置为无效
            var formDataObj = {};
            $.each($('#benche-lisuan-form').serializeArray(), function(index, field){
                if((field.name).substring(0,3) =='row'){
                    formDataObj[field.name] = field.value;
                }
            });
            $.ajax({
                type: "POST",
                dataType: "json",
                url: "{:url('buchang/chakan/lisuan_save')}" ,
                data:formDataObj,
                success: function (res) {
                    // msg(res)
                }
            });
        // })

    }
</script>
<!--补偿款信息-->
<script>
    //保存补偿款信息
    function buchangkuan(){
        // layer.confirm('确认保存吗？', {
        //     btn: ['确定', '取消'], //按钮
        //     shade: false //不显示遮罩
        // }, function(index,layero) {
        //     $(layero).find('.layui-layer-btn0').css('pointer-events','none');// 将确认按钮鼠标事件设置为无效
        //     $(layero).find('.layui-layer-btn0').html('保存中...');// 将确认按钮鼠标事件设置为无效
            $.ajax({
                url: "{:url('buchang/chakan/shoukuan')}",
                data: $('#benche-buchangkuan-form').serializeArray(),
                type: 'post',
                dataType: 'json',
                success: function (res) {
                    // msg(res)
                }
            })
        // })

    }
    //删除补偿款信息
    function benche_shoukuan_del(table){
        var row_length = table.rows.length - 1;
        if( row_length == 1){
            layer.msg('至少保留一条',{time:1000,icon:2})
            return false
        }
        DeleteRow(table,1);
        return false

        var id = '';
        $('.bc_id').each(function(){
            if($(this).is(':checked')){
                id += ','+$(this).val();
            }
        })
        id=id.substring(1);
        if(!id){
            layer.msg('请选择要删除的数据',{time:1000,icon:2})
            return false
        }

        var row_length = table.rows.length - 1;
        var ids = id.split(",");
        if( ids.length == row_length || row_length == 1){
            layer.alert('至少保留一条')
            return false
        }
        layer.confirm('确认删除吗？', {
            btn: ['确定', '取消'], //按钮
            shade: false //不显示遮罩
        }, function(index) {
            $.ajax({
                url:"{:url('buchang/chakan/sanche_shoukuan_del')}",
                data:{id:id,type:'shoukuan'},
                type:'post',
                dataType:'json',
                success:function(res){
                    DeleteRow(table,1);
                }
            })
        })

    }
    //保存其他信息
    function qita_save(){
        // layer.confirm('确认保存吗？', {
        //     btn: ['确定', '取消'], //按钮
        //     shade: false //不显示遮罩
        // }, function(index,layero) {
        //     $(layero).find('.layui-layer-btn0').css('pointer-events','none');// 将确认按钮鼠标事件设置为无效
        //     $(layero).find('.layui-layer-btn0').html('保存中...');// 将确认按钮鼠标事件设置为无效
            $.ajax({
                url: "{:url('buchang/chakan/qita_save')}",
                data: $('#benche-qita-form').serializeArray(),
                type: 'post',
                dataType: 'json',
                success: function (res) {
                    // msg(res)
                }
            })
        // })


    }
    //删除其他信息
    function benche_qita_del(table){
        var row_length = table.rows.length - 1;
        if( row_length == 1){
            layer.msg('至少保留一条',{time:1000,icon:2})
            return false
        }
        DeleteRow(table,1);
        return  false
        var id = '';
        $('.bc_id').each(function(){
            if($(this).is(':checked')){
                id += ','+$(this).val();
            }
        })

        id=id.substring(1);
        if(!id){
            layer.msg('请选择要删除的数据',{time:1000,icon:2})
            return false
        }

        var row_length = table.rows.length - 1;
        var ids = id.split(",");
        if( ids.length == row_length || row_length == 1){
            layer.alert('至少保留一条')
            return false
        }
        layer.confirm('确认删除吗？', {
            btn: ['确定', '取消'], //按钮
            shade: false //不显示遮罩
        }, function(index) {
            $.ajax({
                url:"{:url('buchang/chakan/benche_shoukuan_del')}",
                data:{id:id,type:'qita'},
                type:'post',
                dataType:'json',
                success:function(res){
                    DeleteRow(table,1);
                }
            })
        })

    }
</script>
